<template>
    <div id="todoInfo">
        <a-page-header
            style="border: 1px solid rgb(235, 237, 240)"
            :title="title + '详情页'"
            @back="goBack"
        />
        <a-form :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" v-for="(item,i) in formData.processFormPropertyValues" :key="i">
            <a-form-item :label="item.caption" v-if="item.mobileVisible">
              <a-input
                :value = "item.value"
                disabled
              />
            </a-form-item>
        </a-form>
    </div>
</template>
<script>

export default {
    name: "TodoInfo",
    data () {
        return {
            data:  this.$route.params.data,  // 获取路由参数iD
            size: 'default',
            title: this.$route.params.cate,
            formData: []
        }
    },
    methods: {
        goBack: function(){
            history.back();
        },
        getFormData: function(url){
            this.$axios.get(url).then(res => {
                console.log(res.data.processFormData)
                // 指向Vue实例
                // this.list = res.data.datas;
                this.formData = res.data.processFormData
            }).catch(err => {
                console.warn(err);
            })
        }
    },
    created: function(){
        console.log(this.$route.params.infoURL)
        this.getFormData(this.$route.params.infoURL)
    },
    computed: {
        // getTitle: function(){
        //     // return `来自${this.data.creatorName}的${this.data.title}`
        // }
    },
    filters: {    // 过滤器 格式化时间戳
      formatTime: function(value){
        let date = new Date(value);
        let Y = date.getFullYear();
        let m = date.getMonth() + 1;
        let d = date.getDate();
        let H = date.getHours();
        let i = date.getMinutes();
        let s = date.getSeconds();
        (m < 10) && (m = '0' + m);
        (d < 10) && (d = '0' + d);
        (H < 10) && (H = '0' + H);
        (i < 10) && (i = '0' + i);
        (s < 10) && (s = '0' + s)
        // var t = Y+'-'+m+'-'+d+' '+H+':'+i+':'+s;
        var t = Y + '年' + m + '月' + d + "日";
        return t;
      }
    }
}
</script>

<style scoped>

</style>